//package com.liqi.frame.comm.controller.manager;
//
//import com.rabbitmq.client.Channel;
//import org.springframework.amqp.core.Message;
//import org.springframework.amqp.rabbit.annotation.RabbitHandler;
//import org.springframework.amqp.rabbit.annotation.RabbitListener;
//import org.springframework.stereotype.Component;
//
//import java.io.IOException;
//
///**
// * @author Administrator
// * @since 2020/9/11 13:49
// */
//@Component("CommTestMQReceiver")
//public class CommTestMQReceiver {
////    @RabbitHandler
////    @RabbitListener(queues ="queue_0001")
////    public void onMessage(Message message, Channel channel) throws IOException {
////
////        try {
////            Thread.sleep(5000);
////        } catch (InterruptedException e) {
////            e.printStackTrace();
////        }
////        long deliveryTag = message.getMessageProperties().getDeliveryTag();
////        //手工ack
////        channel.basicAck(deliveryTag,true);
////        System.out.println("receive--1: " + new String(message.getBody()));
////    }
//
//    @RabbitHandler
//    @RabbitListener(queues = "queue_0002")
//    public void onMessage2(Message message, Channel channel) throws IOException {
//
//        try {
//            Thread.sleep(5000);
//        } catch (InterruptedException e) {
//            e.printStackTrace();
//        }
//        long deliveryTag = message.getMessageProperties().getDeliveryTag();
//        //手工ack
//        channel.basicAck(deliveryTag, true);
//        System.out.println("receive--1: " + new String(message.getBody()));
//    }
//
////    @RabbitHandler
////    public void onUserMessage(@Payload User user, Channel channel, @Headers Map<String,Object> headers) throws IOException {
////
////        try {
////            Thread.sleep(5000);
////        } catch (InterruptedException e) {
////            e.printStackTrace();
////        }
////
////        long deliveryTag = (Long)headers.get(AmqpHeaders.DELIVERY_TAG);
////        //手工ack
////        channel.basicAck(deliveryTag,true);
////        System.out.println("receive--11: " + user.toString());
////    }
//}
